package com.zjitc.model;

import java.time.LocalDateTime;
import java.util.List;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/5/24 14:26
 * @description:
 */
public class Order {

  //订单信息
  private String oid; //订单号
  private Double total; //订单总价
  private LocalDateTime ordertime; //下单时间
  private Integer state; //订单状态

  //收货人信息
  private String name;
  private String phone;
  private String address;

  //订单的所有者
  private Integer uid;

  //订单与订单子项
  private List<OrderItem> orderItemList;
  private User user;

  public Order() {
  }

  public Order(String oid, Double total, LocalDateTime ordertime, Integer state,
        String name, String phone, String address, Integer uid,
      List<OrderItem> orderItemList, User user) {
    this.oid = oid;
    this.total = total;
    this.ordertime = ordertime;
    this.state = state;
    this.name = name;
    this.phone = phone;
    this.address = address;
    this.uid = uid;
    this.orderItemList = orderItemList;
    this.user = user;
  }

  public String getOid() {
    return oid;
  }

  public void setOid(String oid) {
    this.oid = oid;
  }

  public Double getTotal() {
    return total;
  }

  public void setTotal(Double total) {
    this.total = total;
  }

  public LocalDateTime getOrdertime(LocalDateTime now) {
    return ordertime;
  }

  public void setOrdertime(LocalDateTime ordertime) {
    this.ordertime = ordertime;
  }

  public Integer getState() {
    return state;
  }

  public void setState(Integer state) {
    this.state = state;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getPhone() {
    return phone;
  }

  public void setPhone(String phone) {
    this.phone = phone;
  }

  public String getAddress() {
    return address;
  }

  public void setAddress(String address) {
    this.address = address;
  }

  public Integer getUid() {
    return uid;
  }

  public void setUid(Integer uid) {
    this.uid = uid;
  }

  public List<OrderItem> getOrderItemList() {
    return orderItemList;
  }

  public void setOrderItemList(List<OrderItem> orderItemList) {
    this.orderItemList = orderItemList;
  }

  public User getUser() {
    return user;
  }

  public void setUser(User user) {
    this.user = user;
  }

  @Override
  public String toString() {
    return "Order{" +
        "oid='" + oid + '\'' +
        ", total=" + total +
        ", ordertime=" + ordertime +
        ", state=" + state +
        ", name='" + name + '\'' +
        ", phone='" + phone + '\'' +
        ", address='" + address + '\'' +
        ", uid=" + uid +
        ", orderItemList=" + orderItemList +
        ", user=" + user +
        '}';
  }

}
